import {get, post, del, put} from '../utils/request'

//按状态分页获取用户订单
export function getOrderList(params) {
    return get('/portal/order/list', params)
}

//获取订单详情
export function getOrderDetail(id) {
    return get('/portal/order/detail/' + id)
}

//取消订单
export function cancelOrder(id) {
    return post('/portal/order/cancel/user/order?orderId=' + id)
}

//确认收货
export function confirmOrder(data) {
    return post('/portal/order/confirm/receive/order?orderId=' + data)
}

// //用户支付订单 支付宝沙箱支付
// export function payOrder(data) {
//     return post('/alipay/pay', data)
// }

//生成订单
export function createOrder(data) {
    return post('/portal/order/generate/order', data)
}

// 根购物车ID生产确认订单
export function generateOrder(data){
    return post('/portal/order/generate/confirm/order', data);
}

//用户支付成功回调
export function paySuccess(data) {
    return post('/portal/order/pay/success')
}

//删除订单
export function deleteOrder(id) {
    return post('/portal/order/delete/order?orderId=' + id)
}
